<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<div id="top_bar">
	<div class="header-panel">
		<div class="site-wrap wrap clearfix">
			<div id="logo"><a href="${ctx}/">ZZZZZZ</a></div>
			<form id="search_form" action="${ctx}/search" method="get" class="mlm"><input type="text" id="search_query" name="q" onfocus="if(this.value=='Search...')this.value=''" onblur="if(this.value=='')this.value='Search...';" value="Search..." /><input type="submit" value="" class="search-btn" id="search_button" /></form>
			<ul class="horizontal nav-index index rfloat">
				<shiro:authenticated>
					<li>
						<a href="${ctx}/" <c:if test="${cur == 'home' || cur == null || empty cur}">class="selected"</c:if> >Home</a>
					</li><li>
						<a href="${ctx}/topic/add" <c:if test="${cur == 'add'}">class="selected"</c:if> >Add ＋</a>
					</li><li>
						<a href="${ctx}/explore" <c:if test="${cur == 'explore'}">class="selected"</c:if> >Explore</a>
					</li><li>
						<a href="${ctx}/profile/${currentUser.userId}" <c:if test="${cur == 'profile'}">class="selected"</c:if> >Profile</a>
					</li><li>
						<a href="${ctx}/people" <c:if test="${cur == 'people'}">class="selected"</c:if> >People</a>
					</li><shiro:hasRole name="administrator"><li>
						<a href="${ctx}/control_panel" <c:if test="${cur == 'control_panel'}">class="selected"</c:if> >Control Panel</a>
					</li></shiro:hasRole><li>
						<a href="#dropdown_link" data-dropdown="{ &quot;align&quot; : &quot;right&quot; }" class="">
							<c:choose>
								<c:when test="${currentUser.thumbnailId == null || empty currentUser.thumbnailId}">
									<img src="${ctx}/res/images/default_portrait.png" class="thumb thumb_28" style="margin-bottom: 6px;"/>
								</c:when>
								<c:otherwise>
									<img src="${ctx}/image/${currentUser.thumbnailId}" class="thumb thumb_28" style="margin-bottom: 6px;"/>
								</c:otherwise>
							</c:choose>
							&nbsp;<span class="arrow arrow-down arrow-down-light arrow-down-medium"></span>
						</a>
						<ul class="vertical dropdown-index index" data-dom-id="dropdown">
							<li><a href="${ctx}/settings/account">Account Settings</a></li>
							<li><a href="${ctx}/help">Help</a></li>
							<li class="divider"><a href="${ctx}/logout">Logout</a></li>
						</ul>
					</li></shiro:authenticated><shiro:notAuthenticated><li>
						<a href="${ctx}/" <c:if test="${cur == 'index'}">class="selected"</c:if> >Home</a>
					</li><li>
						<a href="${ctx}/explore" <c:if test="${cur == 'explore'}">class="selected"</c:if> >Explore</a>
					</li><li>
						<a href="${ctx}/people" <c:if test="${cur == 'people'}">class="selected"</c:if> >People</a>
					</li><li>
						<c:choose>
							<c:when test="${cur == 'login'}">
								<a href="${ctx}/signup">Sign Up</a>
							</c:when>
							<c:otherwise>
								<a href="#dropdown_link" data-dropdown="{ &quot;align&quot; : &quot;right&quot; }">Login <span class="arrow arrow-down arrow-down-light arrow-down-medium"></span></a>
								<div id="login_dropdown" class="vertical dropdown-index index" data-dom-id="dropdown">
									<form action="${ctx}/login" method="post" class="login-dropdown">
										<input type="hidden" name="login-type" value="dropdown"/>
										<div class="fieldset">
											<label for="login_dropdown_email" class="pbs">Email</label>
											<input type="text" id="login_dropdown_email" name="login-dropdown-email" value="" class="" />
										</div>
										<div class="fieldset">
											<label for="login_dropdown_password" class="pbs">Password</label>
											<input type="password" id="login_dropdown_password" name="login-dropdown-password" value="" class="" />
											<p class="fsm fcl">Forgot your <a href="${ctx}/account/resend_password">password</a>?</p>
										</div>
										
										<div class="fieldset clearfix">
											<input type="submit" name="login-dropdown-submit" class="btn style1 medium lfloat" value="Log in" />
											<div class="ui-overflow-hidden remember-me mls">
												<div style="height:28px;" class="ui-inline-block ui-inline-block-middle"></div><div class="ui-inline-block ui-inline-block-middle">
													<input type="checkbox" id="login_dropdown_remember_me" name="login-dropdown-remember-me" value="true" /><label for="login_dropdown_remember_me">Remember me</label>
												</div>
											</div>
										</div>
									</form>
								</div>
							</c:otherwise>
						</c:choose>
					</li>
				</shiro:notAuthenticated>
			</ul>
		</div>
	</div>
</div>
